package models.general;

import play.db.ebean.Model;

import javax.persistence.Entity;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: bjornth
 * Date: 26.3.2013
 * Time: 17:22
 * To change this template use File | Settings | File Templates.
 */
@Entity
public class vKennariHoparOnn extends Model {

    public int persona_id;
    public String nafn;
    public int notandi_id;
    public int skoli_id;
    public String namsgrein_afanganr;
    public int afangi_id;
    public String hopur;
    public int hopur_id;
    public String onn_eink;
    public Date dags_fra;
    public Date dags_til;
    public int onn_id;
    public int annir_afangar_id;

    public static Finder<Integer,vKennariHoparOnn> find = new Finder<Integer,vKennariHoparOnn>(
            Integer.class, vKennariHoparOnn.class
    );

    //returns the classes the teacher getting sent in as the parameter is teaching on the current semester
    public static List<vKennariHoparOnn> getTeacherClasses (int notandi_id) {
        List<vKennariHoparOnn> coursesTeacher = vKennariHoparOnn.find.where().eq("notandi_id", notandi_id).findList();
        return coursesTeacher;
    }

    //returns the classes the teacher getting sent in as the parameter is teaching on the current semester
    public static vKennariHoparOnn getCourse (int notandi_id,int afangi_id) {
        vKennariHoparOnn single = vKennariHoparOnn.find.where().eq("notandi_id", notandi_id).where().eq("afangi_id", afangi_id).findUnique();
        return single;
    }

    //returns the classes the teacher getting sent in as the parameter is teaching on the current semester
    public static List<vKennariHoparOnn> getCourseList(int notandi_id,int afangi_id) {
        List<vKennariHoparOnn> courses = vKennariHoparOnn.find.where().eq("notandi_id", notandi_id).where().eq("afangi_id", afangi_id).findList();
        return courses;
    }


    public int getPersona_id() {
        return persona_id;
    }

    public void setPersona_id(int persona_id) {
        this.persona_id = persona_id;
    }

    public String getNafn() {
        return nafn;
    }

    public void setNafn(String nafn) {
        this.nafn = nafn;
    }

    public int getNotandi_id() {
        return notandi_id;
    }

    public void setNotandi_id(int notandi_id) {
        this.notandi_id = notandi_id;
    }

    public int getSkoli_id() {
        return skoli_id;
    }

    public void setSkoli_id(int skoli_id) {
        this.skoli_id = skoli_id;
    }

    public String getNamsgrein_afanganr() {
        return namsgrein_afanganr;
    }

    public void setNamsgrein_afanganr(String namsgrein_afanganr) {
        this.namsgrein_afanganr = namsgrein_afanganr;
    }

    public int getAfangi_id() {
        return afangi_id;
    }

    public void setAfangi_id(int afangi_id) {
        this.afangi_id = afangi_id;
    }

    public String getHopur() {
        return hopur;
    }

    public void setHopur(String hopur) {
        this.hopur = hopur;
    }

    public int getHopur_id() {
        return hopur_id;
    }

    public void setHopur_id(int hopur_id) {
        this.hopur_id = hopur_id;
    }

    public String getOnn_eink() {
        return onn_eink;
    }

    public void setOnn_eink(String onn_eink) {
        this.onn_eink = onn_eink;
    }

    public Date getDags_fra() {
        return dags_fra;
    }

    public void setDags_fra(Date dags_fra) {
        this.dags_fra = dags_fra;
    }

    public Date getDags_til() {
        return dags_til;
    }

    public void setDags_til(Date dags_til) {
        this.dags_til = dags_til;
    }

    public int getOnn_id() {
        return onn_id;
    }

    public void setOnn_id(int onn_id) {
        this.onn_id = onn_id;
    }

    public int getAnnir_afangar_id() {
        return annir_afangar_id;
    }

    public void setAnnir_afangar_id(int annir_afangar_id) {
        this.annir_afangar_id = annir_afangar_id;
    }
}
